package main;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class mainMIDlet extends MIDlet implements CommandListener
{
    public static MIDlet globalApplicationInstance;
    public static MainCanvas canvas;
    
    Command exitCommand;
    
    public mainMIDlet()
    {
        globalApplicationInstance=this;
    }
    
    public void startMIDlet()
    {
        
    }
    
    public void resumeMIDlet()
    {
        
    }
    
    
    
    public void commandAction(Command command, Displayable displayable)
    {
        
    }
    
    
    
    public Display getDisplay()
    {
        return Display.getDisplay(this);
    }
    
    public void exitMIDlet()
    {
        //switchDisplayable(null, null);
        destroyApp(true);
        notifyDestroyed();
    }
    
    
    
    public void startApp()
    {
        StorageHandler.loadRates();
        if (canvas==null)
        {
            canvas=new MainCanvas(Display.getDisplay(this));
        }
        canvas.startCanvas();
    }
    
    public void pauseApp()
    {
        
    }
    
    public void destroyApp(boolean unconditional)
    {
        notifyDestroyed();
    }
}